package com.example.apiservice.client.fallback;

import com.example.apiservice.client.StudentClient;
import com.example.apiservice.client.TestClient;
import com.example.common.domain.Result;
import com.example.common.domain.pojo.Course;
import com.example.common.domain.pojo.CourseOutline;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

@Slf4j
public class TestClientFallbackFactory implements FallbackFactory<TestClient> {
    @Override
    public TestClient create(Throwable cause) {
        return new TestClient() {
            @Override
            public Result<Course> getCourseById(String id) {
                System.err.println("调用老师模块错误，课程方法");
                return null;
            }

            @Override
            public String test() {
                System.err.println("调用老师模块错误，test方法");
                return "";
            }

            @Override
            public Result<Course> TestPost(Course course) {
                System.err.println("调用老师模块错误，课程方法TestPost");
                return null;
            }

            @Override
            public Result<CourseOutline> getCourseOutline(String courseId) {
                System.err.println("调用老师模块错误，大纲方法");
                return null;
            }

        };

    }
}
